﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Item : MonoBehaviour
{
	Animator ani;
	public ItemType itemType;
	// public ItemType ItemType { get; set; }

	private void Start() {
		ani = GetComponent<Animator>();
		ani.SetBool("Is" + itemType.ToString(), true);
	}

	private void OnTriggerEnter2D(Collider2D other) {
		if (other.gameObject.tag == "Player") {
			Debug.Log("Item被捡到了");
			other.GetComponent<Player>().GetItem(this);
			Destroy(this.gameObject);
		}
	}

}
